|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Macros | |
| #define | TIMER_PERIOD 511 |
| #define | DUTY_CYCLE1 384 |
| #define | DUTY_CYCLE2 128 |
Functions | |
| void | main (void) |
| #define DUTY_CYCLE1 384 |
Definition at line 64 of file timer_a_ex5_pwmMultipleUp.c.
| #define DUTY_CYCLE2 128 |
Definition at line 65 of file timer_a_ex5_pwmMultipleUp.c.
| #define TIMER_PERIOD 511 |
This program generates two PWM outputs on P2.0,P2.1 using Timer1_A configured for up mode. The value in CCR0, 512-1, defines the PWM period and the values in CCR1 and CCR2 the PWM duty cycles. Using ~1.045MHz SMCLK as TACLK, the timer period is ~500us with a 75% duty cycle on P2.2 and 25% on P2.3. ACLK = n/a, SMCLK = MCLK = TACLK = default DCO ~1.045MHz.
| / | | |
|---|---|
| – | RST |
| | | P2.0/TA1.1|--> CCR1 - 75% PWM | P2.1/TA1.2|--> CCR2 - 25% PWM
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 63 of file timer_a_ex5_pwmMultipleUp.c.
| void main | ( | void | ) |
Definition at line 67 of file timer_a_ex5_pwmMultipleUp.c.
References __no_operation(), DUTY_CYCLE1, DUTY_CYCLE2, and TIMER_PERIOD.